<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>用户注册</title>
</head>
<body style="background: #01AAED">
<div class="window">
	<fieldset class="layui-elem-field" style="margin: 25px;">
		<legend>注册</legend>
		<div class="layui-field-box">
			<form class="layui-form layui-form-pane">
				<div class="layui-form-item">
					<label class="layui-form-label">账号</label>
					<div class="layui-input-inline">
						<input type="text" name="code" placeholder="请输入账号"
							autocomplete="off" class="layui-input" lay-verify="required">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">密码</label>
					<div class="layui-input-inline">
						<input type="password" name="pass" placeholder="请输入密码"
							autocomplete="off" class="layui-input" lay-verify="required">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">姓名</label>
					<div class="layui-input-inline">
						<input type="text" name="name" lay-verify="required"
							placeholder="请输入姓名" autocomplete="off" class="layui-input">
					</div>
				</div>
				<input type="button" lay-submit lay-filter="reg" value="注册" class="layui-btn"  />
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<button type="button" class="layui-btn" onclick="goJspLogin()">返回登录</button>
				<input type="hidden" name="action" value="reg">
			</form>
		</div>
	</fieldset>
	</div>
	<script type="text/javascript">
// 	var form=layui.form,$=layui.jquery,layer=layui.layer;
// 	form.on("submit(reg)",function(data){
// 		console.log(data.field)
// 		$.ajax({
// 			url:base.app+"/employee",
// 			type:"post",
// 			data:data.field,
// 			dataType:"text",
// 			success:function(data){
// // 				console.log(data)
// 			}
// 		})
// 	})
formSubmit('/employee','submit(reg)','text',function(data){
	console.log(123)
	console.log(data)
	if(data==1){
		layer.msg("注册成功")
	}else if(data=="repeat"){
		layer.msg("注册失败，账号重复")
	}
})
	function goJspLogin(){
		location.href=base.app+"/web/login.jsp"
	}
	</script>
</body>
</html>